package com.iot.network;

import com.iot.messaage.SendMessage;
import io.vertx.core.net.NetSocket;

/**
 * @author Administrator
 */
public class TcpDeviceSession implements DeviceSession {

    private final NetSocket exchange;

    public TcpDeviceSession(NetSocket exchange) {
        this.exchange = exchange;
    }

    @Override
    public void onClose(Runnable var1) {
        exchange.close();
    }

    @Override
    public void send(SendMessage reply) {
        exchange.write(reply.getReplyStr());
    }
}
